package cn.minhx.lab.design_patterns.singleton.f1;

public class Singleton {

    private static Singleton instance;

    /**
     * 构造方法私有化
     */
    private Singleton() {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

    public static Singleton getInstance() {
        if (null == instance) {
            instance = new Singleton();
        }
        return instance;
    }

}
